import React from 'react';
import { Icon } from 'antd';
import { primaryColor } from '@/defaultSettings';
import styles from './index.less';

const CollapseHead = ({ title, expand, color, ...rest }) => (
    <div className={styles.custom} {...rest}>
        <span style={{ marginRight: 8, color }}>{title}</span>
        <Icon
            className={styles.customIcon}
            type="double-right"
            rotate={expand ? -90 : 90}
            style={{ color: color || primaryColor }}
        />
    </div>
);

export default CollapseHead;
